package cn.highset.modules.base.service.mybatis;

import cn.highset.modules.base.entity.Province;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Map;

/**
 * @author Victor
 */
@CacheConfig(cacheNames = "province")
public interface IProvinceService extends IService<Province> {
    /**
     * 获取集合
     *
     * @return
     */
    @Cacheable()
    List<Map<String, Object>> provinceList();

    /**
     * 通过id获取  名称
     *
     * @param provinceId
     * @return
     */
    @Cacheable(key = "'getlabel:'+#provinceId")
    String getLabelById(String provinceId);

    /**
     * 通过id获取  名称
     *
     * @param label
     * @return
     */
    @Cacheable(key = "'getid:'+#label")
    String getIdByLabel(String label);
}
